<?php

require_once dirname(__FILE__).'/../lib/lodgingPhotoGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/lodgingPhotoGeneratorHelper.class.php';

/**
 * lodgingPhoto actions.
 *
 * @package    SchelkinoBiz
 * @subpackage lodgingPhoto
 * @author     Delight
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class lodgingPhotoActions extends autoLodgingPhotoActions
{

    public function executePrepareDirs(sfWebRequest $request)
    {
        $lodging_dir = sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR.sfConfig::get('app_photos_dir');

        if ( !is_dir($lodging_dir) ) {
            mkdir($lodging_dir);
        }

        foreach ( sfConfig::get('app_photos_dirs') as $path )
        {
            $dir = $lodging_dir.DIRECTORY_SEPARATOR.$path;

            if ( !is_dir($dir) ) {
                mkdir($dir);
            }
        }

        $this->redirect('@lodging_photo');
    }

}
